#include <bits/stdc++.h>
#define N 100002
using namespace std;
int a[N],n;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    if(n==1){
        cout<<1;
    }else{
        sort(a+1,a+n+1);
        int i=n,j=1;
        while(1){
            if(a[i]>a[j]){
                j++;
                i--;
            }else{
                break;
            }
        }
        if(i==j)cout<<n-j;
        else cout<<n-j+1;
    }
    return 0;
}
